import request from '@/utils/request'

export function fetchList(params) {
  return request({
    url: '/permission/list',
    method: 'get',
    params: params
  })
}
export function getData(id) {
  return request({
    url: '/permission/'+id,
    method: 'get'
  })
}

export function getMenuEnum() {
  return request({
    url: '/permission/getMenuEnum',
    method: 'get'
  })
}

export function getTree() {
  return request({
    url: '/permission/getTree',
    method: 'get'
  })
}

export function getTree2() {
  return request({
    url: '/permission/getTree2',
    method: 'get'
  })
}

export function addData(data) {
  return request({
    url: '/permission/add',
    method: 'post',
    data: data
  })
}

export function deleteData(id) {
  return request({
    url: '/permission/'+id,
    method:'delete',
  })
}

export function updateData(id,data) {
  return request({
    url: '/permission/' + id,
    method: 'put',
    data: data
  })
}
